package cn.itcast.pojo;

import cn.itcast.converter.EnumConverter;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@TableName("students")
public class Students {
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ExcelProperty("姓名")
    private String name;

    @ExcelProperty("学号")
    private String no;

    @ExcelProperty(value = "性别", converter = EnumConverter.class)
    private Integer gender;

    @ExcelProperty("手机号")
    private String phone;

    @ExcelProperty("身份证号")
    private String idCard;

    @ExcelProperty(value = "是否来自院校", converter = EnumConverter.class)
    private Integer isCollege;

    @ExcelProperty("居住地址")
    private String address;

    @ExcelProperty(value = "学历", converter = EnumConverter.class)
    private Integer degree;

    @ExcelProperty("毕业时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date graduationDate;

    // 以下字段Excel中不存在
    private Integer violationCount = 0;
    private Integer violationScore = 0;
    private Integer clazzId;
    private String clazzName;
    private Date createTime = new Date();
    private Date updateTime = new Date();
}
